Optimal. Leaf size=150 \[ -\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) (d+e x)^{-1+m} \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (1-m) (2-m)}+\frac {g (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d e (2-m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 42, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {808, 662}
\begin {gather*} \frac {g (d+e x)^m \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d e (2-m)}-\frac {(d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m} \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right )}{c^2 d^2 e (1-m) (2-m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 662
Rule 808
Rubi steps
\begin {align*} \int (d+e x)^m (f+g x) \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx &=\frac {g (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d e (2-m)}-\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) \int (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx}{c d e (2-m)}\\ &=-\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) (d+e x)^{-1+m} \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (1-m) (2-m)}+\frac {g (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d e (2-m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 67, normalized size = 0.45 \begin {gather*} -\frac {(d+e x)^{-1+m} ((a e+c d x) (d+e x))^{1-m} (a e g+c d (f (-2+m)+g (-1+m) x))}{c^2 d^2 (-2+m) (-1+m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 89, normalized size = 0.59
method | result | size |
gosper | \(-\frac {\left (e x +d \right )^{m} \left (c d g m x +c d f m -c d g x +a e g -2 c d f \right ) \left (c d x +a e \right ) \left (c d e \,x^{2}+a \,e^{2} x +c \,d^{2} x +a d e \right )^{-m}}{c^{2} d^{2} \left (m^{2}-3 m +2\right )}\) | \(89\) |
risch | \(-\frac {\left (g \,x^{2} c^{2} d^{2} m +a c d e g m x +c^{2} d^{2} f m x -g \,x^{2} c^{2} d^{2}+a c d e f m -2 c^{2} d^{2} f x +a^{2} e^{2} g -2 a c d e f \right ) \left (e x +d \right )^{m} {\mathrm e}^{\frac {m \left (i \pi \mathrm {csgn}\left (i \left (e x +d \right ) \left (c d x +a e \right )\right )^{3}-i \pi \mathrm {csgn}\left (i \left (e x +d \right ) \left (c d x +a e \right )\right )^{2} \mathrm {csgn}\left (i \left (e x +d \right )\right )-i \pi \mathrm {csgn}\left (i \left (e x +d \right ) \left (c d x +a e \right )\right )^{2} \mathrm {csgn}\left (i \left (c d x +a e \right )\right )+i \pi \,\mathrm {csgn}\left (i \left (e x +d \right ) \left (c d x +a e \right )\right ) \mathrm {csgn}\left (i \left (e x +d \right )\right ) \mathrm {csgn}\left (i \left (c d x +a e \right )\right )-2 \ln \left (e x +d \right )-2 \ln \left (c d x +a e \right )\right )}{2}}}{c^{2} d^{2} \left (m -2\right ) \left (-1+m \right )}\) | \(257\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.33, size = 97, normalized size = 0.65 \begin {gather*} -\frac {{\left (c d x + a e\right )} f}{{\left (c d x + a e\right )}^{m} c d {\left (m - 1\right )}} - \frac {{\left (c^{2} d^{2} {\left (m - 1\right )} x^{2} + a c d m x e + a^{2} e^{2}\right )} g}{{\left (m^{2} - 3 \, m + 2\right )} {\left (c d x + a e\right )}^{m} c^{2} d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.80, size = 144, normalized size = 0.96 \begin {gather*} -\frac {{\left (a^{2} g e^{2} + {\left (c^{2} d^{2} g m - c^{2} d^{2} g\right )} x^{2} + {\left (c^{2} d^{2} f m - 2 \, c^{2} d^{2} f\right )} x + {\left (a c d g m x + a c d f m - 2 \, a c d f\right )} e\right )} {\left (x e + d\right )}^{m}}{{\left (c^{2} d^{2} m^{2} - 3 \, c^{2} d^{2} m + 2 \, c^{2} d^{2}\right )} {\left (c d^{2} x + a x e^{2} + {\left (c d x^{2} + a d\right )} e\right )}^{m}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 369 vs.
\(2 (143) = 286\).
time = 3.12, size = 369, normalized size = 2.46 \begin {gather*} -\frac {{\left (x e + d\right )}^{m} c^{2} d^{2} g m x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + {\left (x e + d\right )}^{m} c^{2} d^{2} f m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} - {\left (x e + d\right )}^{m} c^{2} d^{2} g x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + {\left (x e + d\right )}^{m} a c d g m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} - 2 \, {\left (x e + d\right )}^{m} c^{2} d^{2} f x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right )\right )} + {\left (x e + d\right )}^{m} a c d f m e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} - 2 \, {\left (x e + d\right )}^{m} a c d f e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 1\right )} + {\left (x e + d\right )}^{m} a^{2} g e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (x e + d\right ) + 2\right )}}{c^{2} d^{2} m^{2} - 3 \, c^{2} d^{2} m + 2 \, c^{2} d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.36, size = 139, normalized size = 0.93 \begin {gather*} -\frac {\frac {g\,x^2\,\left (m-1\right )\,{\left (d+e\,x\right )}^m}{m^2-3\,m+2}+\frac {x\,{\left (d+e\,x\right )}^m\,\left (a\,e\,g\,m-2\,c\,d\,f+c\,d\,f\,m\right )}{c\,d\,\left (m^2-3\,m+2\right )}+\frac {a\,e\,{\left (d+e\,x\right )}^m\,\left (a\,e\,g-2\,c\,d\,f+c\,d\,f\,m\right )}{c^2\,d^2\,\left (m^2-3\,m+2\right )}}{{\left (c\,d\,e\,x^2+\left (c\,d^2+a\,e^2\right )\,x+a\,d\,e\right )}^m} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________